﻿using System;
namespace Producers.Rr.Xtee.Riik.Ee.Producer.Rr {
    
    
    [global::Xtee.Core.Attributes.XmlTypeAttribute(Name="RR81Response", Namespace="http://producers.rr.xtee.riik.ee/producer/rr", Target=typeof(RR81Response))]
    public class RR81ResponseSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
        
        protected IRR81Response clazz;
        
        public RR81ResponseSerializer(IRR81Response clazz) {
            this.clazz = clazz;
        }
        
        public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
            base.WriteXml(Writer);
            Writer.WriteStartElement("Eesnimi");
            if (clazz.Eesnimi!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Eesnimi))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Eesnimi");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Perenimi");
            if (clazz.Perenimi!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Perenimi))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Perenimi");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Isikukood");
            if (clazz.Isikukood!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Isikukood))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Isikukood");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Sugu");
            if (clazz.Sugu!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Sugu))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Sugu");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Synniaeg");
            if (clazz.Synniaeg!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Synniaeg))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Synniaeg");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Vanaeesnimi");
            if (clazz.Vanaeesnimi!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Vanaeesnimi))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Vanaeesnimi");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Vanaperenimi");
            if (clazz.Vanaperenimi!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Vanaperenimi))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Vanaperenimi");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Istaatuskd");
            if (clazz.Istaatuskd!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Istaatuskd))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Istaatuskd");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Istaatus");
            if (clazz.Istaatus!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Istaatus))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Istaatus");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Kstaatuskd");
            if (clazz.Kstaatuskd!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Kstaatuskd))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Kstaatuskd");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Kstaatus");
            if (clazz.Kstaatus!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Kstaatus))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Kstaatus");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Kodakondsus");
            if (clazz.Kodakondsus!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Kodakondsus))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Kodakondsus");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Synnikoht");
            if (clazz.Synnikoht!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Synnikoht))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Synnikoht");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("EOkuni");
            if (clazz.EOkuni!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EOkuni))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : EOkuni");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("EOalates");
            if (clazz.EOalates!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EOalates))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : EOalates");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("EOstaatus");
            if (clazz.EOstaatus!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EOstaatus))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : EOstaatus");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Pereseis");
            if (clazz.Pereseis!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Pereseis))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Pereseis");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Pereseisukuup");
            if (clazz.Pereseisukuup!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Pereseisukuup))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Pereseisukuup");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Surmaaktnr");
            if (clazz.Surmaaktnr!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Surmaaktnr))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Surmaaktnr");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Surmakuupaev");
            if (clazz.Surmakuupaev!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Surmakuupaev))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Surmakuupaev");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Veakood");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.Veakood))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("Veatekst");
            if (clazz.Veatekst!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Veatekst))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Veatekst");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Isikudok");
            if (clazz.Isikudok!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute(">>>RR81Response>Isikudok>Isikudok", "http://producers.rr.xtee.riik.ee/producer/rr", clazz.Isikudok.Count);
                for (int x = 0; ((clazz.Isikudok != null) 
                            && (x < clazz.Isikudok.Count)); x = (x + 1)) {
                    if (clazz.Isikudok[x]!=null) {
                        Writer.WriteStartElement("Isikudok");
                        global::Xtee.Core.SerializationMetadata metaIsikudok = this.GetMetaData(clazz.Isikudok[x]);
                        Writer.WriteTypeAttribute(metaIsikudok.TypeQualifiedName.Namespace, metaIsikudok.TypeQualifiedName.Name);
                        metaIsikudok.NewSerializer(clazz.Isikudok[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Isikudok");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Seotud_isikud");
            if (clazz.SeotudIsikud!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute(">>>RR81Response>Seotud_isikud>Seotud_isikud", "http://producers.rr.xtee.riik.ee/producer/rr", clazz.SeotudIsikud.Count);
                for (int x = 0; ((clazz.SeotudIsikud != null) 
                            && (x < clazz.SeotudIsikud.Count)); x = (x + 1)) {
                    if (clazz.SeotudIsikud[x]!=null) {
                        Writer.WriteStartElement("Seotud_isikud");
                        global::Xtee.Core.SerializationMetadata metaSeotudIsikud = this.GetMetaData(clazz.SeotudIsikud[x]);
                        Writer.WriteTypeAttribute(metaSeotudIsikud.TypeQualifiedName.Namespace, metaSeotudIsikud.TypeQualifiedName.Name);
                        metaSeotudIsikud.NewSerializer(clazz.SeotudIsikud[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : SeotudIsikud");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Sama_aadressiga");
            if (clazz.SamaAadressiga!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute(">>>RR81Response>Sama_aadressiga>Sama_aadressiga", "http://producers.rr.xtee.riik.ee/producer/rr", clazz.SamaAadressiga.Count);
                for (int x = 0; ((clazz.SamaAadressiga != null) 
                            && (x < clazz.SamaAadressiga.Count)); x = (x + 1)) {
                    if (clazz.SamaAadressiga[x]!=null) {
                        Writer.WriteStartElement("Sama_aadressiga");
                        global::Xtee.Core.SerializationMetadata metaSamaAadressiga = this.GetMetaData(clazz.SamaAadressiga[x]);
                        Writer.WriteTypeAttribute(metaSamaAadressiga.TypeQualifiedName.Namespace, metaSamaAadressiga.TypeQualifiedName.Name);
                        metaSamaAadressiga.NewSerializer(clazz.SamaAadressiga[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : SamaAadressiga");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Elukoht");
            if (clazz.Elukoht!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute(">>>RR81Response>Elukoht>Elukoht", "http://producers.rr.xtee.riik.ee/producer/rr", clazz.Elukoht.Count);
                for (int x = 0; ((clazz.Elukoht != null) 
                            && (x < clazz.Elukoht.Count)); x = (x + 1)) {
                    if (clazz.Elukoht[x]!=null) {
                        Writer.WriteStartElement("Elukoht");
                        global::Xtee.Core.SerializationMetadata metaElukoht = this.GetMetaData(clazz.Elukoht[x]);
                        Writer.WriteTypeAttribute(metaElukoht.TypeQualifiedName.Namespace, metaElukoht.TypeQualifiedName.Name);
                        metaElukoht.NewSerializer(clazz.Elukoht[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Elukoht");
            }
            Writer.WriteEndElement();
        }
        
        public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
            base.ReadXml(Reader);
            if (Reader.LocalName=="Eesnimi") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR81Response>Eesnimi");
                }
                clazz.Eesnimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Eesnimi")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR81Response>Eesnimi", Reader.LocalName);
            }
            if (Reader.LocalName=="Perenimi") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR81Response>Perenimi");
                }
                clazz.Perenimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Perenimi")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR81Response>Perenimi", Reader.LocalName);
            }
            if (Reader.LocalName=="Isikukood") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR81Response>Isikukood");
                }
                clazz.Isikukood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikukood")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR81Response>Isikukood", Reader.LocalName);
            }
            if (Reader.LocalName=="Sugu") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR81Response>Sugu");
                }
                clazz.Sugu = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Sugu")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR81Response>Sugu", Reader.LocalName);
            }
            if (Reader.LocalName=="Synniaeg") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR81Response>Synniaeg");
                }
                clazz.Synniaeg = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Synniaeg")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR81Response>Synniaeg", Reader.LocalName);
            }
            if (Reader.LocalName=="Vanaeesnimi") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR81Response>Vanaeesnimi");
                }
                clazz.Vanaeesnimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Vanaeesnimi")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR81Response>Vanaeesnimi", Reader.LocalName);
            }
            if (Reader.LocalName=="Vanaperenimi") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR81Response>Vanaperenimi");
                }
                clazz.Vanaperenimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Vanaperenimi")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR81Response>Vanaperenimi", Reader.LocalName);
            }
            if (Reader.LocalName=="Istaatuskd") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR81Response>Istaatuskd");
                }
                clazz.Istaatuskd = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Istaatuskd")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR81Response>Istaatuskd", Reader.LocalName);
            }
            if (Reader.LocalName=="Istaatus") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR81Response>Istaatus");
                }
                clazz.Istaatus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Istaatus")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR81Response>Istaatus", Reader.LocalName);
            }
            if (Reader.LocalName=="Kstaatuskd") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR81Response>Kstaatuskd");
                }
                clazz.Kstaatuskd = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Kstaatuskd")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR81Response>Kstaatuskd", Reader.LocalName);
            }
            if (Reader.LocalName=="Kstaatus") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR81Response>Kstaatus");
                }
                clazz.Kstaatus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Kstaatus")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR81Response>Kstaatus", Reader.LocalName);
            }
            if (Reader.LocalName=="Kodakondsus") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR81Response>Kodakondsus");
                }
                clazz.Kodakondsus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Kodakondsus")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR81Response>Kodakondsus", Reader.LocalName);
            }
            if (Reader.LocalName=="Synnikoht") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR81Response>Synnikoht");
                }
                clazz.Synnikoht = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Synnikoht")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR81Response>Synnikoht", Reader.LocalName);
            }
            if (Reader.LocalName=="EOkuni") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR81Response>EOkuni");
                }
                clazz.EOkuni = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("EOkuni")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR81Response>EOkuni", Reader.LocalName);
            }
            if (Reader.LocalName=="EOalates") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR81Response>EOalates");
                }
                clazz.EOalates = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("EOalates")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR81Response>EOalates", Reader.LocalName);
            }
            if (Reader.LocalName=="EOstaatus") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR81Response>EOstaatus");
                }
                clazz.EOstaatus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("EOstaatus")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR81Response>EOstaatus", Reader.LocalName);
            }
            if (Reader.LocalName=="Pereseis") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR81Response>Pereseis");
                }
                clazz.Pereseis = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Pereseis")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR81Response>Pereseis", Reader.LocalName);
            }
            if (Reader.LocalName=="Pereseisukuup") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR81Response>Pereseisukuup");
                }
                clazz.Pereseisukuup = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Pereseisukuup")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR81Response>Pereseisukuup", Reader.LocalName);
            }
            if (Reader.LocalName=="Surmaaktnr") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR81Response>Surmaaktnr");
                }
                clazz.Surmaaktnr = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Surmaaktnr")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR81Response>Surmaaktnr", Reader.LocalName);
            }
            if (Reader.LocalName=="Surmakuupaev") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR81Response>Surmakuupaev");
                }
                clazz.Surmakuupaev = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Surmakuupaev")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR81Response>Surmakuupaev", Reader.LocalName);
            }
            if (Reader.LocalName=="Veakood") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR81Response>Veakood");
                }
                clazz.Veakood = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("Veakood")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR81Response>Veakood", Reader.LocalName);
            }
            if (Reader.LocalName=="Veatekst") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR81Response>Veatekst");
                }
                clazz.Veatekst = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Veatekst")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR81Response>Veatekst", Reader.LocalName);
            }
            if (Reader.LocalName=="Isikudok") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR81Response>Isikudok");
                }
                clazz.Isikudok = new System.Collections.Generic.List<RR81Response.IIsikudokType>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("Isikudok");
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "Isikudok")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>RR81Response>Isikudok>Isikudok");
                        }
                        global::Xtee.Core.SerializationMetadata metaIsikudok = this.GetMetaData<RR81Response.IIsikudokType>(Reader, ">>>RR81Response>Isikudok>Isikudok", "http://producers.rr.xtee.riik.ee/producer/rr");
                        RR81Response.IIsikudokType item = metaIsikudok.NewEntity<RR81Response.IIsikudokType>();
                        clazz.Isikudok.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("Isikudok");
                            metaIsikudok.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR81Response>Isikudok", Reader.LocalName);
            }
            if (Reader.LocalName=="Seotud_isikud") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR81Response>Seotud_isikud");
                }
                clazz.SeotudIsikud = new System.Collections.Generic.List<RR81Response.ISeotudIsikudType>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("Seotud_isikud");
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "Seotud_isikud")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>RR81Response>Seotud_isikud>Seotud_isikud");
                        }
                        global::Xtee.Core.SerializationMetadata metaSeotudIsikud = this.GetMetaData<RR81Response.ISeotudIsikudType>(Reader, ">>>RR81Response>Seotud_isikud>Seotud_isikud", "http://producers.rr.xtee.riik.ee/producer/rr");
                        RR81Response.ISeotudIsikudType item = metaSeotudIsikud.NewEntity<RR81Response.ISeotudIsikudType>();
                        clazz.SeotudIsikud.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("Seotud_isikud");
                            metaSeotudIsikud.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR81Response>Seotud_isikud", Reader.LocalName);
            }
            if (Reader.LocalName=="Sama_aadressiga") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR81Response>Sama_aadressiga");
                }
                clazz.SamaAadressiga = new System.Collections.Generic.List<RR81Response.ISamaAadressigaType>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("Sama_aadressiga");
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "Sama_aadressiga")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>RR81Response>Sama_aadressiga>Sama_aadressiga");
                        }
                        global::Xtee.Core.SerializationMetadata metaSamaAadressiga = this.GetMetaData<RR81Response.ISamaAadressigaType>(Reader, ">>>RR81Response>Sama_aadressiga>Sama_aadressiga", "http://producers.rr.xtee.riik.ee/producer/rr");
                        RR81Response.ISamaAadressigaType item = metaSamaAadressiga.NewEntity<RR81Response.ISamaAadressigaType>();
                        clazz.SamaAadressiga.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("Sama_aadressiga");
                            metaSamaAadressiga.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR81Response>Sama_aadressiga", Reader.LocalName);
            }
            if (Reader.LocalName=="Elukoht") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR81Response>Elukoht");
                }
                clazz.Elukoht = new System.Collections.Generic.List<RR81Response.IElukohtType>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("Elukoht");
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "Elukoht")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>RR81Response>Elukoht>Elukoht");
                        }
                        global::Xtee.Core.SerializationMetadata metaElukoht = this.GetMetaData<RR81Response.IElukohtType>(Reader, ">>>RR81Response>Elukoht>Elukoht", "http://producers.rr.xtee.riik.ee/producer/rr");
                        RR81Response.IElukohtType item = metaElukoht.NewEntity<RR81Response.IElukohtType>();
                        clazz.Elukoht.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("Elukoht");
                            metaElukoht.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR81Response>Elukoht", Reader.LocalName);
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>>RR81Response>Isikudok>Isikudok", Namespace="http://producers.rr.xtee.riik.ee/producer/rr", Target=typeof(RR81Response.IsikudokType))]
        public class IsikudokTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected RR81Response.IIsikudokType clazz;
            
            public IsikudokTypeSerializer(RR81Response.IIsikudokType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                Writer.WriteStartElement("Isikudok.Dokliik");
                if (clazz.IsikudokDokliik!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikudokDokliik))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikudokDokliik");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikudok.Doknr");
                if (clazz.IsikudokDoknr!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikudokDoknr))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikudokDoknr");
                }
                Writer.WriteEndElement();
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="Isikudok.Dokliik") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR81Response>Isikudok>Isikudok>Isikudok.Dokliik");
                    }
                    clazz.IsikudokDokliik = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikudok.Dokliik")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR81Response>Isikudok>Isikudok>Isikudok.Dokliik", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikudok.Doknr") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR81Response>Isikudok>Isikudok>Isikudok.Doknr");
                    }
                    clazz.IsikudokDoknr = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikudok.Doknr")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR81Response>Isikudok>Isikudok>Isikudok.Doknr", Reader.LocalName);
                }
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>>RR81Response>Seotud_isikud>Seotud_isikud", Namespace="http://producers.rr.xtee.riik.ee/producer/rr", Target=typeof(RR81Response.SeotudIsikudType))]
        public class SeotudIsikudTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected RR81Response.ISeotudIsikudType clazz;
            
            public SeotudIsikudTypeSerializer(RR81Response.ISeotudIsikudType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                Writer.WriteStartElement("Seotud_isikud.Eesnimi");
                if (clazz.SeotudIsikudEesnimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.SeotudIsikudEesnimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : SeotudIsikudEesnimi");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Seotud_isikud.Perenimi");
                if (clazz.SeotudIsikudPerenimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.SeotudIsikudPerenimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : SeotudIsikudPerenimi");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Seotud_isikud.Isikukood");
                if (clazz.SeotudIsikudIsikukood!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.SeotudIsikudIsikukood))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : SeotudIsikudIsikukood");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Seotud_isikud.Sugu");
                if (clazz.SeotudIsikudSugu!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.SeotudIsikudSugu))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : SeotudIsikudSugu");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Seotud_isikud.Synniaeg");
                if (clazz.SeotudIsikudSynniaeg!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.SeotudIsikudSynniaeg))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : SeotudIsikudSynniaeg");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Seotud_isikud.IstaatusKd");
                if (clazz.SeotudIsikudIstaatusKd!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.SeotudIsikudIstaatusKd))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : SeotudIsikudIstaatusKd");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Seotud_isikud.Istaatus");
                if (clazz.SeotudIsikudIstaatus!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.SeotudIsikudIstaatus))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : SeotudIsikudIstaatus");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Seotud_isikud.Kstaatuskd");
                if (clazz.SeotudIsikudKstaatuskd!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.SeotudIsikudKstaatuskd))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : SeotudIsikudKstaatuskd");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Seotud_isikud.Kstaatus");
                if (clazz.SeotudIsikudKstaatus!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.SeotudIsikudKstaatus))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : SeotudIsikudKstaatus");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Seotud_isikud.Alates");
                if (clazz.SeotudIsikudAlates!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.SeotudIsikudAlates))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : SeotudIsikudAlates");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Seotud_isikud.Kuni");
                if (clazz.SeotudIsikudKuni!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.SeotudIsikudKuni))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : SeotudIsikudKuni");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Seotud_isikud.SuheTyyp");
                if (clazz.SeotudIsikudSuheTyyp!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.SeotudIsikudSuheTyyp))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : SeotudIsikudSuheTyyp");
                }
                Writer.WriteEndElement();
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="Seotud_isikud.Eesnimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR81Response>Seotud_isikud>Seotud_isikud>Seotud_isikud.Eesnimi");
                    }
                    clazz.SeotudIsikudEesnimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Seotud_isikud.Eesnimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR81Response>Seotud_isikud>Seotud_isikud>Seotud_isikud.Eesnimi", Reader.LocalName);
                }
                if (Reader.LocalName=="Seotud_isikud.Perenimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR81Response>Seotud_isikud>Seotud_isikud>Seotud_isikud.Perenimi");
                    }
                    clazz.SeotudIsikudPerenimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Seotud_isikud.Perenimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR81Response>Seotud_isikud>Seotud_isikud>Seotud_isikud.Perenimi", Reader.LocalName);
                }
                if (Reader.LocalName=="Seotud_isikud.Isikukood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR81Response>Seotud_isikud>Seotud_isikud>Seotud_isikud.Isikukood");
                    }
                    clazz.SeotudIsikudIsikukood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Seotud_isikud.Isikukood")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR81Response>Seotud_isikud>Seotud_isikud>Seotud_isikud.Isikukood", Reader.LocalName);
                }
                if (Reader.LocalName=="Seotud_isikud.Sugu") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR81Response>Seotud_isikud>Seotud_isikud>Seotud_isikud.Sugu");
                    }
                    clazz.SeotudIsikudSugu = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Seotud_isikud.Sugu")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR81Response>Seotud_isikud>Seotud_isikud>Seotud_isikud.Sugu", Reader.LocalName);
                }
                if (Reader.LocalName=="Seotud_isikud.Synniaeg") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR81Response>Seotud_isikud>Seotud_isikud>Seotud_isikud.Synniaeg");
                    }
                    clazz.SeotudIsikudSynniaeg = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Seotud_isikud.Synniaeg")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR81Response>Seotud_isikud>Seotud_isikud>Seotud_isikud.Synniaeg", Reader.LocalName);
                }
                if (Reader.LocalName=="Seotud_isikud.IstaatusKd") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR81Response>Seotud_isikud>Seotud_isikud>Seotud_isikud.IstaatusKd");
                    }
                    clazz.SeotudIsikudIstaatusKd = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Seotud_isikud.IstaatusKd")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR81Response>Seotud_isikud>Seotud_isikud>Seotud_isikud.IstaatusKd", Reader.LocalName);
                }
                if (Reader.LocalName=="Seotud_isikud.Istaatus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR81Response>Seotud_isikud>Seotud_isikud>Seotud_isikud.Istaatus");
                    }
                    clazz.SeotudIsikudIstaatus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Seotud_isikud.Istaatus")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR81Response>Seotud_isikud>Seotud_isikud>Seotud_isikud.Istaatus", Reader.LocalName);
                }
                if (Reader.LocalName=="Seotud_isikud.Kstaatuskd") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR81Response>Seotud_isikud>Seotud_isikud>Seotud_isikud.Kstaatuskd");
                    }
                    clazz.SeotudIsikudKstaatuskd = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Seotud_isikud.Kstaatuskd")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR81Response>Seotud_isikud>Seotud_isikud>Seotud_isikud.Kstaatuskd", Reader.LocalName);
                }
                if (Reader.LocalName=="Seotud_isikud.Kstaatus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR81Response>Seotud_isikud>Seotud_isikud>Seotud_isikud.Kstaatus");
                    }
                    clazz.SeotudIsikudKstaatus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Seotud_isikud.Kstaatus")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR81Response>Seotud_isikud>Seotud_isikud>Seotud_isikud.Kstaatus", Reader.LocalName);
                }
                if (Reader.LocalName=="Seotud_isikud.Alates") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR81Response>Seotud_isikud>Seotud_isikud>Seotud_isikud.Alates");
                    }
                    clazz.SeotudIsikudAlates = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Seotud_isikud.Alates")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR81Response>Seotud_isikud>Seotud_isikud>Seotud_isikud.Alates", Reader.LocalName);
                }
                if (Reader.LocalName=="Seotud_isikud.Kuni") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR81Response>Seotud_isikud>Seotud_isikud>Seotud_isikud.Kuni");
                    }
                    clazz.SeotudIsikudKuni = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Seotud_isikud.Kuni")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR81Response>Seotud_isikud>Seotud_isikud>Seotud_isikud.Kuni", Reader.LocalName);
                }
                if (Reader.LocalName=="Seotud_isikud.SuheTyyp") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR81Response>Seotud_isikud>Seotud_isikud>Seotud_isikud.SuheTyyp");
                    }
                    clazz.SeotudIsikudSuheTyyp = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Seotud_isikud.SuheTyyp")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR81Response>Seotud_isikud>Seotud_isikud>Seotud_isikud.SuheTyyp", Reader.LocalName);
                }
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>>RR81Response>Sama_aadressiga>Sama_aadressiga", Namespace="http://producers.rr.xtee.riik.ee/producer/rr", Target=typeof(RR81Response.SamaAadressigaType))]
        public class SamaAadressigaTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected RR81Response.ISamaAadressigaType clazz;
            
            public SamaAadressigaTypeSerializer(RR81Response.ISamaAadressigaType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                Writer.WriteStartElement("Sama_aadressiga.Eesnimi");
                if (clazz.SamaAadressigaEesnimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.SamaAadressigaEesnimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : SamaAadressigaEesnimi");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Sama_aadressiga.Perenimi");
                if (clazz.SamaAadressigaPerenimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.SamaAadressigaPerenimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : SamaAadressigaPerenimi");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Sama_aadressiga.Isikukood");
                if (clazz.SamaAadressigaIsikukood!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.SamaAadressigaIsikukood))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : SamaAadressigaIsikukood");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Sama_aadressiga.Sugu");
                if (clazz.SamaAadressigaSugu!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.SamaAadressigaSugu))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : SamaAadressigaSugu");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Sama_aadressiga.Synniaeg");
                if (clazz.SamaAadressigaSynniaeg!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.SamaAadressigaSynniaeg))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : SamaAadressigaSynniaeg");
                }
                Writer.WriteEndElement();
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="Sama_aadressiga.Eesnimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR81Response>Sama_aadressiga>Sama_aadressiga>Sama_aadressiga.Eesnimi");
                    }
                    clazz.SamaAadressigaEesnimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Sama_aadressiga.Eesnimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR81Response>Sama_aadressiga>Sama_aadressiga>Sama_aadressiga.Eesnimi", Reader.LocalName);
                }
                if (Reader.LocalName=="Sama_aadressiga.Perenimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR81Response>Sama_aadressiga>Sama_aadressiga>Sama_aadressiga.Perenimi");
                    }
                    clazz.SamaAadressigaPerenimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Sama_aadressiga.Perenimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR81Response>Sama_aadressiga>Sama_aadressiga>Sama_aadressiga.Perenimi", Reader.LocalName);
                }
                if (Reader.LocalName=="Sama_aadressiga.Isikukood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR81Response>Sama_aadressiga>Sama_aadressiga>Sama_aadressiga.Isikukood");
                    }
                    clazz.SamaAadressigaIsikukood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Sama_aadressiga.Isikukood")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR81Response>Sama_aadressiga>Sama_aadressiga>Sama_aadressiga.Isikukood", Reader.LocalName);
                }
                if (Reader.LocalName=="Sama_aadressiga.Sugu") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR81Response>Sama_aadressiga>Sama_aadressiga>Sama_aadressiga.Sugu");
                    }
                    clazz.SamaAadressigaSugu = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Sama_aadressiga.Sugu")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR81Response>Sama_aadressiga>Sama_aadressiga>Sama_aadressiga.Sugu", Reader.LocalName);
                }
                if (Reader.LocalName=="Sama_aadressiga.Synniaeg") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR81Response>Sama_aadressiga>Sama_aadressiga>Sama_aadressiga.Synniaeg");
                    }
                    clazz.SamaAadressigaSynniaeg = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Sama_aadressiga.Synniaeg")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR81Response>Sama_aadressiga>Sama_aadressiga>Sama_aadressiga.Synniaeg", Reader.LocalName);
                }
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>>RR81Response>Elukoht>Elukoht", Namespace="http://producers.rr.xtee.riik.ee/producer/rr", Target=typeof(RR81Response.ElukohtType))]
        public class ElukohtTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected RR81Response.IElukohtType clazz;
            
            public ElukohtTypeSerializer(RR81Response.IElukohtType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                Writer.WriteStartElement("Elukoht.Riikkd");
                if (clazz.ElukohtRiikkd!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohtRiikkd))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohtRiikkd");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukoht.Maakond");
                if (clazz.ElukohtMaakond!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohtMaakond))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohtMaakond");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukoht.Linn");
                if (clazz.ElukohtLinn!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohtLinn))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohtLinn");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukoht.Asula");
                if (clazz.ElukohtAsula!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohtAsula))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohtAsula");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukoht.Vkoht");
                if (clazz.ElukohtVkoht!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohtVkoht))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohtVkoht");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukoht.Tanav");
                if (clazz.ElukohtTanav!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohtTanav))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohtTanav");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukoht.Nimi");
                if (clazz.ElukohtNimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohtNimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohtNimi");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukoht.Maja");
                if (clazz.ElukohtMaja!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohtMaja))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohtMaja");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukoht.Korter");
                if (clazz.ElukohtKorter!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohtKorter))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohtKorter");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukoht.Sihtnumber");
                if (clazz.ElukohtSihtnumber!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohtSihtnumber))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohtSihtnumber");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukoht.Alates");
                if (clazz.ElukohtAlates!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohtAlates))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohtAlates");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukoht.Kuni");
                if (clazz.ElukohtKuni!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohtKuni))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohtKuni");
                }
                Writer.WriteEndElement();
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="Elukoht.Riikkd") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR81Response>Elukoht>Elukoht>Elukoht.Riikkd");
                    }
                    clazz.ElukohtRiikkd = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukoht.Riikkd")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR81Response>Elukoht>Elukoht>Elukoht.Riikkd", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukoht.Maakond") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR81Response>Elukoht>Elukoht>Elukoht.Maakond");
                    }
                    clazz.ElukohtMaakond = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukoht.Maakond")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR81Response>Elukoht>Elukoht>Elukoht.Maakond", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukoht.Linn") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR81Response>Elukoht>Elukoht>Elukoht.Linn");
                    }
                    clazz.ElukohtLinn = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukoht.Linn")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR81Response>Elukoht>Elukoht>Elukoht.Linn", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukoht.Asula") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR81Response>Elukoht>Elukoht>Elukoht.Asula");
                    }
                    clazz.ElukohtAsula = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukoht.Asula")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR81Response>Elukoht>Elukoht>Elukoht.Asula", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukoht.Vkoht") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR81Response>Elukoht>Elukoht>Elukoht.Vkoht");
                    }
                    clazz.ElukohtVkoht = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukoht.Vkoht")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR81Response>Elukoht>Elukoht>Elukoht.Vkoht", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukoht.Tanav") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR81Response>Elukoht>Elukoht>Elukoht.Tanav");
                    }
                    clazz.ElukohtTanav = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukoht.Tanav")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR81Response>Elukoht>Elukoht>Elukoht.Tanav", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukoht.Nimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR81Response>Elukoht>Elukoht>Elukoht.Nimi");
                    }
                    clazz.ElukohtNimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukoht.Nimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR81Response>Elukoht>Elukoht>Elukoht.Nimi", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukoht.Maja") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR81Response>Elukoht>Elukoht>Elukoht.Maja");
                    }
                    clazz.ElukohtMaja = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukoht.Maja")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR81Response>Elukoht>Elukoht>Elukoht.Maja", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukoht.Korter") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR81Response>Elukoht>Elukoht>Elukoht.Korter");
                    }
                    clazz.ElukohtKorter = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukoht.Korter")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR81Response>Elukoht>Elukoht>Elukoht.Korter", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukoht.Sihtnumber") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR81Response>Elukoht>Elukoht>Elukoht.Sihtnumber");
                    }
                    clazz.ElukohtSihtnumber = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukoht.Sihtnumber")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR81Response>Elukoht>Elukoht>Elukoht.Sihtnumber", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukoht.Alates") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR81Response>Elukoht>Elukoht>Elukoht.Alates");
                    }
                    clazz.ElukohtAlates = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukoht.Alates")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR81Response>Elukoht>Elukoht>Elukoht.Alates", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukoht.Kuni") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR81Response>Elukoht>Elukoht>Elukoht.Kuni");
                    }
                    clazz.ElukohtKuni = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukoht.Kuni")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR81Response>Elukoht>Elukoht>Elukoht.Kuni", Reader.LocalName);
                }
            }
        }
    }
}
